package Singleton;

/**
 * @Author: 蔡翔
 * @Date: 2019/11/18 16:22
 * @Version 1.0
 */
public class T implements Runnable {
    public void run() {
        //1. 普通模式
        //LazySingleton lazySingleton = LazySingleton.getInstance();
        //LazyDoubleCheckSingleton instance = LazyDoubleCheckSingleton.getInstance();

        //2. 静态内部类
        /*StaticInnerClassSingleton staticInnerClassSingleton = StaticInnerClassSingleton.getInstance();
        System.out.println(Thread.currentThread().getName()+ " " + staticInnerClassSingleton);*/

        //3. ThreadLocal的
        ThreadLocalInstance instance = ThreadLocalInstance.getInstance();
        System.out.println(Thread.currentThread().getName() + " " +instance);

    }
}
